home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.2
/
Video Toaster v4.2.iso
/
arexx
/
cg
/
epsload.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-12-28
|
2KB
|
85 lines
/* EpsLoad.rexx -- Convert and load an EPS file. */
/* By Bob Caron © 1994 NewTek, Inc. */
call addlib(CG_AREXX,0)
if ~exists("Toaster:Brushes") then address command "c:makedir toaster:Brushes"
filnam = 'ENV:EpsLoad.state'
version = 'EpsLoad v1.4'
if (exists(filnam)) then do
if (~open(state, filnam, 'R')) then break
if (readln(state) ~= version) then break
file=readln(state)
end
call close state
if lastpos('/',file,length(file)-1)~=0 then do
filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
path=left(file,(lastpos('/',file,length(file))-1))
end
else do
filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
path=left(file,(lastpos(':',file,length(file))))
end
if file="FILE" | file="" then do
path="Toaster:PSFonts/"
filenam=""
end
infile=REQ_file("Choose an EPS File:",filenam,path)
if infile="" then
exit
file=script
if (open(state, filnam, 'W')) then do
call writeln state, version
call writeln state, infile
call close state
end
width=0
height=0
if GET_LINE(TYPE) = 'Box' then do
width=word(get_rect(SIZE),1)
height=word(get_rect(SIZE),2)
end
if (width+height)<=0 then do
call req_tell("Error: You must create a box","and then select it.")
exit
end
if lastpos('/',infile,length(infile)-1)~=0 then do
filenam=right(infile,(length(infile)-lastpos('/',infile,length(infile)-1)))
path=left(infile,(lastpos('/',infile,length(infile))-1))
end
else do
filenam=right(infile,(length(infile)-lastpos(':',infile,length(infile)-1)))
path=left(infile,(lastpos(':',infile,length(infile))))
call req_tell("here2")
end
call req_bar("Converting EPS File...")
address command "C:psimage "||value("infile")||" toaster:brushes/"||value("filenam")||"."||value("height")||" "||value(width)||" "||value("height")||" "
call LOADBRUSH("toaster:brushes/"||value("filenam")||"."||value("height"))
call set_char(face,value("filenam")||"."||value("height"))
call req_tell("Converted and loaded:",value("filenam")||"."||value("height"))
call req_bar("ToasterCG")
call REMLIB(CG_AREXX)
exit